﻿using Furion;
using Microsoft.Extensions.DependencyInjection;

namespace Mrhd.Application
{
    [AppStartup(20)]
    public class Startup : AppStartup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            // 注册选项
            services.AddConfigurableOptions<AppInfoOptions>();

            // 获取选项
            var appInfo = App.GetOptions<AppInfoOptions>();

            // 注册分布式缓存
            services.AddStackExchangeRedisCache(option =>
            {
                option.Configuration = App.Configuration["Redis:Connection"];
                option.InstanceName = App.Configuration["Redis:Prefix"];
            });
        }

    }
}